// [
//   {
//     id: 37,
//     attrName: "分类",
//     categoryId: 1,
//     categoryLevel: 3,
//     attrValueList: [
//       {
//         id: 32,
//         valueName: "Java",
//         attrId: 37,
//       },
//       {
//         id: 34,
//         valueName: "JavaScript",
//         attrId: 37,
//       },
//       {
//         id: 33,
//         valueName: "C#",
//         attrId: 37,
//       },
//     ],
//   },
// ];

export interface AttrListParams {
  category1Id: number;
  category2Id: number;
  category3Id: number;
}

export interface AttrValueItem {
  id?: number;
  valueName: string;
  // attrId: number;
}
export type AttrValueList = AttrValueItem[];

// 属性值列表，包含isEdit
export interface SaveAttrValueItem extends AttrValueItem {
  isShow: boolean;
}
export type SaveAttrValueList = SaveAttrValueItem[];

export interface SaveAttrItem {
  id?: number;
  attrName: string;
  attrValueList: SaveAttrValueList;
}

// ts文档：https://juejin.cn/post/7018805943710253086

// Pick从SaveAttrItem类型中挑选"id" | "attrName"，组成一个新类型
// export interface AttrItem extends Pick<SaveAttrItem, "id" | "attrName"> {

// Omit从SaveAttrItem类型中排除"attrValueList"，剩下属性组成一个新类型
export interface AttrItem extends Omit<SaveAttrItem, "attrValueList"> {
  categoryId: number;
  categoryLevel: number;
  attrValueList: AttrValueList;
}
export type AttrList = AttrItem[];



